/**
 * @description start命令校验路径
 * @export
 * @param {('app' | 'view' | 'control' | string)} type
 * @param {string} path
 * @return {*}  {boolean}
 */
export function startCheckPath(type: 'app' | 'view' | 'control' | string, path: string): boolean {
  let flag = true;
  if (!path || path == '') {
    return false;
  }
  switch (type) {
    case 'app':
      // const appReg = /PSSYSAPPS[\/\\]{1,2}[a-zA-Z0-9_]*/g;
      const appReg = /PSSYSAPPS/g;
      if (!appReg.test(path)) {
        flag = false;
      }
      break;
    case 'view':
      const viewReg = /PSSYSAPPS[\/\\]{1,2}[a-zA-Z0-9_]*[\/\\]{1,2}PSAPPDEVIEWS/g;
      if (!viewReg.test(path) || !path.endsWith('.json')) {
        flag = false;
      }
      break;
    case 'control':
      const ctrlReg = /PSSYSAPPS[\/\\]{1,2}[a-zA-Z0-9_]*[\/\\]{1,2}PSAPPDATAENTITIES/g;
      if (!ctrlReg.test(path) || !path.endsWith('.json')) {
        flag = false;
      }
      break;
    default:
      flag = false;
      break;
  }
  return flag;
}